/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dunify;

import java.util.ArrayList;
import java.util.Collection;
import lunify.LProcessor;
import lunify.Row;

/**
 *
 * @author katie
 */
public class Wiki extends LProcessor{
    // 
    public Wiki(){
        super("wiki","wikipedia","http://www.wikipedia.org/");
    }
    protected Wiki(String name, String title, String url){
        super(name,title,url);
    }

    @Override
    protected Collection<Row> process(String line) {
        Collection<Row> out = new ArrayList<Row>();
        if(line.indexOf("\t")==-1)
            return out;
        //System.out.println(line);
        String[] halves = line.split("\t");
        int i = halves[0].indexOf(":");
        if(i!=-1){
            halves[0] = halves[0].substring(i+1);
        }
        out.add(new Row(halves[0].trim().toLowerCase(), halves[1].trim().toLowerCase()));
        //System.out.println();
        return out;
    }

}
